package com.albaba.consumer.controller;

import com.albaba.consumer.config.RestTemplateConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * @author zx
 * @version 1.0
 * @description TODO
 * @date 2024/11/5 19:22
 */
@RestController
public class ConsumerController {

    @Resource
    private RestTemplateConfig restTemplateConfig;

    @Value("${service-url.nacos-user-service}")
    private String serviceUrl;

    @GetMapping(value = "/consumer/nacos")
    public String getDiscover() {
        return restTemplateConfig.restTemplate().getForObject(serviceUrl + "/mashibing", String.class);
    }

}
